package keeto.com.vn.bms.ui.adapter;

import java.util.ArrayList;


import keeto.com.vn.bms.ui.fragment.CalendarFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;

public class MonthPagerAdapter extends FragmentPagerAdapter{
	public  final static int NUMBER_OF_PAGES = 4;
	
	
	private ArrayList<CalendarFragment> arrayList;

	public ArrayList<CalendarFragment> getArrayList() {
		if (arrayList == null) {
			arrayList = new ArrayList<CalendarFragment>();
			for (int i = 0; i < getCount(); i++) {
				arrayList.add(new CalendarFragment());
			}
		}
		return arrayList;
	}

	public void setArrayList(ArrayList<CalendarFragment> arrayList) {
		this.arrayList = arrayList;
	}

	public MonthPagerAdapter(FragmentManager fm) {
		super(fm);
		// TODO Auto-generated constructor stub
	}

	@Override
	public Fragment getItem(int pos) {
		// TODO Auto-generated method stub
		CalendarFragment fragment = getArrayList().get(pos);
		return fragment;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return NUMBER_OF_PAGES;
	}

}
